<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="embroot.css">
<TITLE>
Remote Tcl Interface
</TITLE>
</HEAD>
<BODY >
<A HREF="embroot016.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot036.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H1 CLASS="chapter"><A NAME="htoc47">Chapter&nbsp;6</A>&nbsp;&nbsp;Remote Tcl Interface</H1>
<A NAME="chapremote"></A>

<BR>
<BR>
This chapter describes the remote Tcl interface, which allows a separate
external Tcl program to interact with ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> in much the same fashion as
the embedding Tcl interface (see chapter&nbsp;<A HREF="embroot016.html#chaptcl">5</A>). Like the embedding
interface, Tcl and ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> code communicates by sending and receiving 
streams of bytes via I/O queues (the <B>ec_rpc</B> mechanism is
implemented on top of these queues). 
The interface can thus be
used in similar fashion to the embedding interface, e.g. for the
development of graphical user interfaces to an ECLiPSe application, with the
difference that the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> program is a separate program and not
embedded into the Tcl program.<BR>
<BR>
The main features of the interface are:
<UL CLASS="itemize"><LI CLASS="li-itemize">
The connection between the Tcl and ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> processes are established
via sockets using TCP network protocol. Thus the Tcl process can be run on
a different machine and platform from the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> process. 
<LI CLASS="li-itemize">The Tcl process can be attached to any running ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> process,
including an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> embedded into another host language.
<LI CLASS="li-itemize">More than one Tcl (or other remote) process can be attached to a
single ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> via the remote interface. 
<LI CLASS="li-itemize">For the programmer, the embedding and remote interfaces are largely
similar, and once the connection is established in the remote interface,
the same code on the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> and Tcl sides can be used for both interfaces.
</UL>
The remote interface thus offers more flexibility than an embedding
interface in how the Tcl code can be connected to an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>
program. However, as the Tcl and ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> processes are not as tightly
coupled as in an embedded interface, the speed of communications between
the Tcl and ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> processes is likely to be slower.<BR>
<BR>
<UL>
<LI><A HREF="embroot027.html">Basic Concepts of the Interface</A>
<LI><A HREF="embroot028.html">Loading the Interface</A>
<LI><A HREF="embroot029.html">Attaching and Initialising the Interface</A>
<UL>
<LI><A HREF="embroot029.html#toc23">A Note on Security</A>
</UL>
<LI><A HREF="embroot030.html">Type Conversion Between Tcl and ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP></A>
<LI><A HREF="embroot031.html">Executing an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> Goal From Tcl</A>
<LI><A HREF="embroot032.html">Communication via Queues</A>
<UL>
<LI><A HREF="embroot032.html#toc24">Queue Data Handlers</A>
<LI><A HREF="embroot032.html#toc25">Synchronous Queues</A>
<LI><A HREF="embroot032.html#toc26">Asynchronous Queues</A>
<LI><A HREF="embroot032.html#toc27">Reusable Queue Names</A>
<LI><A HREF="embroot032.html#toc28">Translating the Queue Names</A>
</UL>
<LI><A HREF="embroot033.html">Additional Control and Support</A>
<UL>
<LI><A HREF="embroot033.html#toc29">Initialisation During Attachment</A>
<LI><A HREF="embroot033.html#toc30">Disconnection and Control Transfer Support</A>
</UL>
<LI><A HREF="embroot034.html">Example</A>
<LI><A HREF="embroot035.html">Differences From the Tcl Embedding Interface</A>
</UL>
<BR>
<BR>

<HR WIDTH="50%" SIZE=1><DL CLASS="list"><DT CLASS="dt-list"><A NAME="note4" HREF="embroot027.html#text4"><FONT SIZE=5>1</FONT></A><DD CLASS="dd-list">The ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side may be more complicated than a simple ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>, as it can be
an embedded ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>, or the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> process and other attached remote
processes.
<DT CLASS="dt-list"><A NAME="note5" HREF="embroot029.html#text5"><FONT SIZE=5>2</FONT></A><DD CLASS="dd-list">Instead of <B>remote_connect/3</B>, the more
flexible <A HREF="../bips/kernel/externals/remote_connect_setup-3.html"><B>remote_connect_setup/3</B></A><A NAME="@default120"></A> and <A HREF="../bips/kernel/externals/remote_connect_accept-6.html"><B>remote_connect_accept/6</B></A><A NAME="@default121"></A>
pair of predicates can be used. See the reference manual entries for these predicates for more
details.
<DT CLASS="dt-list"><A NAME="note6" HREF="embroot029.html#text6"><FONT SIZE=5>3</FONT></A><DD CLASS="dd-list">See
	section&nbsp;<A HREF="embroot024.html#secexdrtcl">5.8</A> for more on EXDR format
<DT CLASS="dt-list"><A NAME="note7" HREF="embroot032.html#text7"><FONT SIZE=5>4</FONT></A><DD CLASS="dd-list">For compatibility with previous
 versions of the embedded Tcl interface, the mode can also be
 specified as r (equivalent to fromec) or w (equivalent to
 toec). These can be somewhat confusing as read/write status depends
 on from which side the queue is viewed (a read queue in ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> is a
 write queue in Tcl).
</DL>
<HR>
<A HREF="embroot016.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot036.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
